package de.unimannheim.ki.algorithmn;

import java.util.ArrayList;
import java.util.List;

import de.unimannheim.ki.databaseentities.Musicuser;
import de.unimannheim.ki.usermanagement.DatabaseUserDAO;


public class NNAlgorithm {
	
	private IComparator re;

	public NNAlgorithm(IComparator re) {
		super();
		this.re = re;
	
	}
	
	public List<Neighbour> computeNeighbours(Musicuser mu){

		DatabaseUserDAO dao = DatabaseUserDAO.getDAO();
		
		List<Musicuser> allUsers = dao.getAllUserswithLastfm();
		
		List<Neighbour> neighbours = this.re.computeDistance(allUsers, mu);
		
		return neighbours;
	}
	public List<Neighbour> computeNeighbours(Musicuser mu, List<Musicuser> allUsers){
		
		List<Neighbour> neighbours = this.re.computeDistance(allUsers, mu);
		
		return neighbours;
	}

}
